ContainsSubStr

Note: This statement is named Contains Substring in the Add Statement dialog box.

Returns True or False to indicate if a string contains a substring.

Syntax

ContainsSubStr("FullString", "Substring", IsCaseSensitive)

Arguments

Argument Description
FullString Full string to search.
Substring Substring to search for in the full string.
IsCaseSensitive Case sensitive search. True matches the substring case. False ignores the case. If not specified, True is used.

Return value

Value Description
True String contains the substring.
False String does not contain the substring.

Example

productName = Window("Bug Reporter").HTMLElement("elementProductName").Property("Inner Text")

CheckpointExpression(ContainsSubStr(productName, "Report", True), True, "Product name does not contain Report")